﻿using System.Collections.Generic;
using System.Linq;
using LBoL.Base;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Battle.BattleActions;
using LBoL.Core.Battle.Interactions;
using LBoL.Core.Cards;
using LBoL.Core.StatusEffects;
using LBoLEntitySideloader.Attributes;
using ProbeMod.Cards.Template;
using ProbeMod.StatusEffects;

namespace ProbeMod.Cards
{
    public sealed class ProbeGLHFDef : ProbeCardTemplate
    {
        public override CardConfig MakeConfig()
        {
            CardConfig config = GetCardDefaultConfig();

            config.Rarity = Rarity.Uncommon;
            config.Type = CardType.Ability;
            config.TargetType = TargetType.Nobody;

            config.Colors = new List<ManaColor>() { ManaColor.Blue,ManaColor.White };
            config.Cost = new ManaGroup() { Blue = 1, White = 1 };
            config.UpgradedCost = new ManaGroup() { Any = 0 };

            config.Keywords = Keyword.Ethereal;
            config.UpgradedKeywords = Keyword.Ethereal;

            config.Value1 = 15;
            config.Value2 = 5;

            config.Index = CardIndexGenerator.GetUniqueIndex(config);
            return config;
        }
    }

    /// <summary>
    /// glhf
    /// 直到战斗结束：若你没有受到伤害，获得15金；若没有使用攻击牌，随机永久升级牌库一张牌；若没有获得过护盾或格挡，获得5点最大生命值。无法叠加
    /// </summary>
    [EntityLogic(typeof(ProbeGLHFDef))]
    public sealed class ProbeGLHF : ProbeCard
    {
        protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
        {
            yield return BuffAction<ProbeNoMissSe>();
            yield return BuffAction<ProbeNoShootSe>();
            yield return BuffAction<ProbeNoBlockSe>();
        }
    }
}
